package com.inspur.dgov.bsp.user.feign;

import com.inspur.dgov.bsp.user.entity.PubUser;
import com.inspur.dgov.common.secure.dto.AuthUser;
import com.inspur.dgov.common.tool.api.R;
import com.inspur.dgov.common.tool.constant.AppConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * User Feign接口类
 *
 * @Author chiyupei
 * @Date 19/7/1 下午7:09
 * @Version 1.0
 * @Description User Feign接口类
 */
@FeignClient(value = AppConstant.APPLICATION_USER_NAME)
public interface IUserFeign {

    String API_PREFIX = "/user";

    /**
     * 获取用户信息
     *
     * @param account  账号
     * @param password 密码
     * @param tenantId 租户ID
     * @return
     */
    @GetMapping(API_PREFIX + "/userInfo")
    R<AuthUser> userInfo(@RequestParam("account") String account, @RequestParam("password") String password, @RequestParam("tenantId") Long tenantId);

    /**
     * 创建租户管理员用户
     * @param user
     * @return
     */
    @PostMapping(API_PREFIX + "/addTenantSystemUser")
    R addTenantSystemUser(@RequestBody PubUser user);
}
